//
//  School.swift
//

import Alamofire

extension Network {
    
    enum School {
        case studyDetail(id: String)
        case studySec(cateId: String)
        case studyUnitList(cateId: String, secId: String)
    }
}

extension Network.School: TargetType {
    
    var baseURL: String {
        switch self {
        case .studyDetail:
            return "https://vd.ubestkid.com/"
        default:
            return "https://aicblhapp.ubestkid.com/"
        }
    }
    
    var path: String {
        switch self {
        case .studyDetail:
            return "xtapi/zhuanlan/detail"
        case .studySec:
            return "course/getSecList"
        case .studyUnitList:
            return "course/getUnitsListWithUserData"
        }
    }
    
    var parameters: [String: Any] {
        switch self {
        case let .studyDetail(id):
            return ["mac": "",
                    "exp10": 19,
                    "exp2": 68,
                    "ua": "",
                    "devicetype": 1,
                    "srcApp": "com.ubestkid.collection",
                    "zlId": id,
                    "carrier": "46002",
                    "svip_status": 2,
                    "impsize": 1,
                    "exp7": 93,
                    "exp3": 14,
                    "version": "4.0",
                    "make": "apple",
                    "bannersafe": 0,
                    "oaid": "",
                    "sh": 2208,
                    "network": 1,
                    "vCode": "1_2",
                    "sw": 1242,
                    "cpId": "blh",
                    "splashsafe": 0,
                    "channel": "c2",
                    "exp8": 63,
                    "pkg": "com.ubestkid.collection",
                    "exp4": 71,
                    "model": "iPhone8,2",
                    "osv": "14.6",
                    "idfa": "",
                    "ppi": 401,
                    "apiVersion": "1.1.1",
                    "exp9": 11,
                    "os": 1,
                    "androidid": "",
                    "exp5": 82,
                    "ak": "8f75a52eadde46239f2227ba64eab72b",
                    "exp1": 62,
                    "egvip_status": 2,
                    "age": "1",
                    "appver": "3.8.6",
                    "res_type": 0,
                    "imei": "",
                    "userId": 378630705,
                    "exp6": 70]
        case let .studySec(cateId):
            return ["mac": "",
                    "exp6": 0,
                    "exp2": 0,
                    "ua": "",
                    "devicetype": 1,
                    "srcApp": "com.ubestkid.collection",
                    "carrier": "46002",
                    "svip_status": 0,
                    "impsize": 1,
                    "exp7": 0,
                    "exp3": 0,
                    "version": "4.0",
                    "make": "apple",
                    "bannersafe": 0,
                    "oaid": "",
                    "sh": 2208,
                    "network": 1,
                    "sw": 1242,
                    "cpId": "blh",
                    "splashsafe": 0,
                    "channel": "c2",
                    "exp8": 0,
                    "pkg": "com.ubestkid.collection",
                    "exp4": 0,
                    "model": "iPhone8,2",
                    "osv": "14.6",
                    "idfa": "",
                    "ppi": 401,
                    "apiVersion": "1.1.1",
                    "exp9": 0,
                    "os": 1,
                    "androidid": "",
                    "exp5": 0,
                    "ak": "8f75a52eadde46239f2227ba64eab72b",
                    "exp1": 0,
                    "egvip_status": 0,
                    "age": "1",
                    "cateId": cateId,
                    "appver": "3.8.6",
                    "res_type": 0,
                    "imei": "",
                    "exp10": 0,
                    "userId": "378630705"]
        case let .studyUnitList(cateId, secId):
            return ["mac": "",
                    "exp6": 0,
                    "exp2": 0,
                    "ua": "",
                    "devicetype": 1,
                    "srcApp": "com.ubestkid.collection",
                    "carrier": "46002",
                    "svip_status": 0,
                    "impsize": 1,
                    "exp7": 0,
                    "exp3": 0,
                    "version": "4.0",
                    "make": "apple",
                    "bannersafe": 0,
                    "oaid": "",
                    "sh": 2208,
                    "network": 1,
                    "sw": 1242,
                    "cpId": "blh",
                    "splashsafe": 0,
                    "channel": "c2",
                    "exp8": 0,
                    "secId": secId,
                    "pkg": "com.ubestkid.collection",
                    "exp4": 0,
                    "model": "iPhone8,2",
                    "osv": "14.6",
                    "idfa": "",
                    "ppi": 401,
                    "apiVersion": "1.1.1",
                    "exp9": 0,
                    "os": 1,
                    "androidid": "",
                    "exp5": 0,
                    "ak": "8f75a52eadde46239f2227ba64eab72b",
                    "exp1": 0,
                    "egvip_status": 0,
                    "age": "1",
                    "cateId": cateId,
                    "appver": "3.8.6",
                    "res_type": 0,
                    "imei": "",
                    "exp10": 0,
                    "userId": "378630705"]
        }
    }
}
